const sizeOf = require('image-size');

function getImageSize(imagePath) {
    try {
        // 试图获取图像尺寸
        const dimensions = sizeOf(imagePath);
        return dimensions;
    } catch (error) {
        console.error(`An error occurred while attempting to get the image size: ${error.message}`);
        return { width: 0, height: 0 };
    }
}

module.exports = { getImageSize };
